package com.taxshare.purchaser.controller;

import com.taxshare.mybatis.pager.PageRequest;
import com.taxshare.purchaser.entity.TrainTicketEntity;
import com.taxshare.purchaser.service.TrainTicketCollectService;
import com.taxshare.purchaser.view.dto.TrainTicketDtO;
import com.taxshare.response.beans.Response;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author YANG
 * @date 2021/4/9
 */
@RestController
@RequestMapping("/trainTicketCollect")
@Api(tags = "火车票采集")
public class TrainTicketCollectController {

    @Autowired
    TrainTicketCollectService trainTicketCollectService;

    @PostMapping("/query")
    @ApiOperation(value = "火车票查询", notes = "发票采集")
    public Response<TrainTicketEntity> queryTrainTicket(@RequestBody PageRequest<TrainTicketDtO> query) {
        return trainTicketCollectService.queryTrainTicket(query);
    }

    @PostMapping("/delete")
    @ApiOperation(value = "火车票删除", notes = "发票采集")
    public Response trainTicketDelete(@RequestBody TrainTicketDtO trainTicketDtO) {
        return trainTicketCollectService.trainTicketDelete(trainTicketDtO);
    }

    @PostMapping("/personLiable")
    @ApiOperation(value = "责任人、记账科目、授权报销设置", notes = "未报销")
    public Response personLiable(@RequestBody TrainTicketDtO trainTicketDtO) {
        return trainTicketCollectService.personLiable(trainTicketDtO);
    }

    @PostMapping("/submit")
    @ApiOperation(value = "提交报销", notes = "未报销")
    public Response submitReimbursement(@RequestBody TrainTicketDtO trainTicketDtO) {
        return trainTicketCollectService.submitReimbursement(trainTicketDtO);
    }
}
